<%@page language="java" contentType="text/html;charset=UTF-8"%>
<%@include file="/WEB-INF/core/common/top.jsp" %>
<%@taglib prefix="s" uri="/struts-tags"%>
<link type="text/css" rel="stylesheet" href="${ctx}/core/styles/validatorAuto.css" />
<script src="${ctx}/core/scripts/jquery_last.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>

<script language="javascript">
<!--
	$(document).ready(function(){
		$.formValidator.initConfig({formid:"form0",onerror:function(msg){showMessage(msg);}});
		$("#id").formValidator().inputValidator({min:1,type:"number",onerror:"<s:text name='channel.id.not.null'/>"}).regexValidator({regexp:"intege",datatype:"enum",onerror:"<s:text name='channel.id.integer'/>"});
		$("#code").formValidator().inputValidator({min:1,max:32,onerror:"<s:text name='channel.code.not.null'/>",onerrormax:"<s:text name='channel.code.over.length'/>"});
		$("#name").formValidator().inputValidator({min:1,max:64,onerror:"<s:text name='channel.name.not.null'/>",onerrormax:"<s:text name='channel.name.over.length'/>"});
		$("#channelType").formValidator().inputValidator({min:1,onerror:"<s:text name='channel.type.not.null'/>"});
		$("#multicastIp").formValidator().inputValidator({min:1,onerror:"<s:text name='multicast.ip.not.null'/>"}).regexValidator({regexp:"ip4",datatype:"enum",onerror:"<s:text name='multicast.ip.form.error'/>"});
		$("#port").formValidator().inputValidator({min:1,max:65535,type:"number",onerror:"<s:text name='multicast.port.range'/>"}).regexValidator({regexp:"intege",datatype:"enum",onerror:"<s:text name='multicast.port.integer'/>"});
		
		$("#networkId").formValidator().inputValidator({min:1,type:"number",onerror:"<s:text name='network.id.not.null'/>"}).regexValidator({regexp:"intege",datatype:"enum",onerror:"<s:text name='network.id.integer'/>"});
		$("#transportId").formValidator().inputValidator({min:1,type:"number",onerror:"<s:text name='transport.id.not.null'/>"}).regexValidator({regexp:"intege",datatype:"enum",onerror:"<s:text name='transport.id.integer'/>"});
		$("#serviceId").formValidator().inputValidator({min:1,type:"number",onerror:"<s:text name='service.id.not.null'/>"}).regexValidator({regexp:"intege",datatype:"enum",onerror:"<s:text name='service.id.integer'/>"});
	});	

	function doCancel(){
		location='${ctx}/epgManage/channelManage.action?act=reQuery';
	}
//-->	
</script>

<body style="overflow-x:hidden;overflow-y:auto;" >
<form method="post" action="${ctx}/epgManage/channelManage.action" name="form0" id="form0">
	<s:hidden name="pageState" value="%{pageState}"></s:hidden>
 	<s:if test="pageState=='add'">  
 		<s:hidden name="act" value="addSubmit"></s:hidden>
	</s:if>
	<s:if test="pageState=='edit'">
		<s:hidden name="act" value="editSubmit"></s:hidden>
		<s:hidden name="channel.channelId" value="%{channel.channelId}"></s:hidden>
		<s:hidden name="channel.code" value="%{channel.code}"></s:hidden>
	</s:if>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<%@include file="/WEB-INF/core/common/message.jsp"  %>
   <tr>
    <td width="8"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td>
    <td width="99%" align="left" valign="middle" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;<s:if test="pageState=='edit'"><s:text name="channel.modify"/></s:if><s:if test="pageState=='add'"><s:text name="channel.add"/></s:if></td>
    <td width="8"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
  </tr>

  <tr>
    <td colspan="4" class="biaoge">
         <table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
                 <tr align="left">
                      <td width="6%" bgcolor="#DDE4EA" height=23>&nbsp;<s:text name="channel.id"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
                      	<s:if test="pageState=='edit'">
							<s:property value="channel.channelId"/>
						</s:if>
						<s:else>
                      		<s:textfield id="id" name="channel.channelId" value="%{channel.channelId}" class="textbox_css" style="width:200px" theme="simple"/>
					 	</s:else>
					  </td>
					  <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="channel.code"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
                      	<s:if test="pageState=='edit'">
							<s:property value="channel.code"/>
						</s:if>
						<s:else>
                      		<s:textfield id="code" name="channel.code" value="%{channel.code}" class="textbox_css" style="width:200px" theme="simple"/>
					 	</s:else>
					  </td>
                 </tr>
                 
                 
                 <tr align="left">
                      <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="channel.name"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
                      		<s:textfield id="name" name="channel.name" value="%{channel.name}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>
					  <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="channel.type"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
                      	<select id="channelType" name="channel.channelType.typeId" style="width:100px">
                      		<option value=""></option>
                      		<s:iterator value="channelTypeList" id="st">
                      			<option value="<s:property value='#st.typeId'/>" <s:if test="channel.channelType.typeId==#st.typeId">selected</s:if>><s:text name='%{#attr.st.type}'/></option>
                      		</s:iterator>
                      	</select>
					  </td>
                 </tr>  
                 <tr align="left">
                      <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="multicast.ip"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
                      		<s:textfield id="multicastIp" name="channel.multicastIp" value="%{channel.multicastIp}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>
					  <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="multicast.port"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
					  		<s:textfield id="port" name="channel.multicastPort" value="%{channel.multicastPort}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>
                 </tr> 
                 <tr align="left">
                      <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="network.id"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
                      		<s:textfield id="networkId" name="channel.networkId" value="%{channel.networkId}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>
					  <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="transport.id"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
					  		<s:textfield id="transportId" name="channel.transportId" value="%{channel.transportId}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>
                 </tr> 
                 <tr align="left">
                      <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="service.id"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
                      		<s:textfield id="serviceId" name="channel.serviceId" value="%{channel.serviceId}" class="textbox_css" style="width:200px" theme="simple"/>
					  </td>
					  <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="channel.status"/>&nbsp;<font color="red">*</font></td>
                      <td width="19%" bgcolor="#DDE4EA">
							<select name="channel.status" style="width:100px">
					  			<option value="1" <s:if test="channel.status==1">selected</s:if>><s:text name="message.status.release"/></option>
					  			<option value="0" <s:if test="channel.status==0">selected</s:if>><s:text name="message.status.cancel"/></option>
					  		</select>
					  </td>
                 </tr>
                 <tr align="left">
                      <td width="6%" bgcolor="#DDE4EA" >&nbsp;<s:text name="channel.abstract"/></td>
                      <td width="19%" bgcolor="#DDE4EA" colspan=3>
                      		<s:textarea  name="channel.description" class="textbox_css" cols="40" rows="3" theme="simple"/>
					  </td>
                 </tr> 
                 <tr>
                      <td height="10" colspan="6" background="../core/images/line5.gif">&nbsp;</td>
                 </tr>
                 <tr>
                      <td height="25" colspan="6" align="center">
							<input name="button22" type="submit" class="btn" value=" <s:text name='button.save'/> "/>
			                <input type="button" name="Button11" value=" <s:text name='button.return' /> " class="btn" onClick="doCancel();" />
			           </td>
                 </tr>
             </table>
            </td>
          </tr>
    </table>
   </form>
</body>
